package com.phgame.newsmth.util;

import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;

public class SharePropertyUtil {

	private Context ctx;

	private static SharePropertyUtil instance = null;
	public static SharePropertyUtil getInstance(Context ctx){
		if(instance == null){
			return new SharePropertyUtil(ctx);
		}
		return instance;
	}
	public SharePropertyUtil(Context ctx){
		this.ctx = ctx;
	}
	
	public void writeProperty(String key,String value){
		SharedPreferences pro = ctx.getSharedPreferences("db", 0);
		Editor editor  = pro.edit();//.putString(key, value);
		editor.putString(key, value);
		editor.commit();
		
	}
	public String readProperty(String key){
		SharedPreferences pro = ctx.getSharedPreferences("db", 0);
		return pro.getString(key, "");
		
	}
	
}
